package top.hcode.hoj.dao.common;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Component;
import top.hcode.hoj.dao.BaseDao;
import top.hcode.hoj.mapper.FilePreviewMapper;
import top.hcode.hoj.pojo.entity.common.FilePreview;

/**
 * @author orangej
 * @since 2025/1/2
 */
@Component
public class FilePreviewDao extends BaseDao<FilePreviewMapper, FilePreview> {

    public FilePreview getBySourceFileUrl(String url) {
        QueryWrapper<FilePreview> query = new QueryWrapper<>();
        query.eq("file_url", url);
        return baseMapper.selectOne(query);
    }

}
